/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

header h1 {
    color: #2c3e50;
    margin-bottom: 10px;
}

header p {
    color: #7f8c8d;
}

/* 添加任务区域 */
.add-task {
    margin-bottom: 30px;
}

.add-task h2, .filter-tasks h2, .task-list h2 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1.5rem;
}

#task-form {
    display: flex;
    gap: 10px;
}

#task-input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

#task-form button {
    padding: 12px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

#task-form button:hover {
    background-color: #2980b9;
}

/* 筛选区域 */
.filter-tasks {
    margin-bottom: 20px;
}

.filter-buttons {
    display: flex;
    gap: 10px;
}

.filter-btn {
    padding: 8px 16px;
    background-color: #ecf0f1;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.filter-btn.active {
    background-color: #3498db;
    color: white;
}

.filter-btn:hover:not(.active) {
    background-color: #bdc3c7;
}

/* 任务列表样式 */
.task-list {
    margin-top: 20px;
}

.task-item {
    display: flex;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background-color: #f9f9f9;
    border-radius: 5px;
    border-left: 4px solid #3498db;
    transition: transform 0.2s;
}

.task-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.task-item.completed {
    opacity: 0.7;
    border-left-color: #2ecc71;
}

.task-item.completed .task-text {
    text-decoration: line-through;
}

.task-checkbox {
    margin-right: 15px;
    transform: scale(1.2);
}

.task-text {
    flex: 1;
    font-size: 1rem;
}

.task-actions {
    display: flex;
    gap: 10px;
}

.edit-btn, .delete-btn {
    padding: 5px 10px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.edit-btn {
    background-color: #f39c12;
    color: white;
}

.edit-btn:hover {
    background-color: #e67e22;
}

.delete-btn {
    background-color: #e74c3c;
    color: white;
}

.delete-btn:hover {
    background-color: #c0392b;
}

.empty-message {
    text-align: center;
    color: #7f8c8d;
    padding: 30px;
    font-style: italic;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    #task-form {
        flex-direction: column;
    }
    
    .filter-buttons {
        flex-wrap: wrap;
    }
    
    .task-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .task-actions {
        margin-top: 10px;
        align-self: flex-end;
    }
}